package com.alumni_circle.mapper.home;

import com.alumni_circle.entity.home.SlideShow;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


/**
 * @author  龙小虬
 * @create  2020-07-06 22:11
 **/
public interface SlideShowMapper extends BaseMapper<SlideShow> {

    @Select("UPDATE slideshow SET state = '0' and sequence = #{sequence} WHERE id = #{id}")
    void update(@Param("sequence")String sequence, @Param("id")String id);

    @Select("SELECT picture FROM slideshow WHERE sequence>0 ORDER BY sequence")
    List<String> viewSlideShow();

    @Select("UPDATE slideshow set sequence = '0'")
    void resetSequence();
}
